Cache Size

The Apis Honeystore uses internal caching to achieve high performance. The cached data is also mirrored to disk, to gain high data persistence. The size of this cache is determined by the property "CacheSize". In situations where you are running a high performance configuration, ie. rapid sampling of many items into a database, it might be desirable to specify a different value than the default.

As an absolute minimum, the cache must be big enough to contain at least one data sample, meaning that the size of the cache must be bigger than the "SampleSize" attribute of the biggest item in the database. Further, the cache should also be big enough to hold more than one sample for an item. How many samples it should be able hold depends on how fast you are sampling your data (The resolution attribute). The cache size should not be to small, not to stress your system unnecessarily, and as a rule of thumb the cache duration should not go below 10 minutes. A cache duration of several hours (or days), is a typical choice.

Calculating cache size based on desired cache duration

Cache duration in hours (formula):

                                          (Cache size)*(Sampling rate in sec.)

Cache duration (hrs) = --------------------------------------------------

                                                        3600*(Sample size)

Example:

Cache size = 10040,

Sample size = 8

Sampling rate = 10 sec.

Would yield a cache duration of approximately 3.5 hours.